'use strict';
const db = uniCloud.database();
exports.main = async (event, context) => {
	let data = event.data
	const _id = data._id

	let fields = {
		accept_name: data.accept_name,
		gender: data.gender,
		mobile: data.mobile,
		area: data.area,
		street: data.street
	}
	const res = await db.collection('addresses').where({_id}).update({...fields})
	if(res.updated === 1) {
		return {
			status: 0,
			msg: '修改成功'
		}
	}
	return {
		status: -1,
		msg: '修改失败'
	}
};
